03. Jupyter Notebooks

Jupyter Notebooks

Jupyter with C++

In this lesson, you'll be writing and testing lots of C++ code. C++ is a compiled language, which is to say there is a separate program - the compiler - that converts your code to an executable program that the computer can run. This means that, after you save a new C++ program to file, running it is normally a two step process:

  1. Compile your code with a compiler.
  2. Run the executable file that the compiler outputs.

For example, in the notebook exercises that follow, you'll be saving your code in a file, let's say filename.cpp in a folder called /code. To compile it using the C++17 standard, you can run the following command:

g++ -std=c++17 ./code/filename.cpp 

And then to run the resulting executable file, you can run:

./a.out

Jupyter Notebooks in Udacity Classroom

In this lesson, you will save, compile, and run executables over and over. To make your life simpler, we've set things up so you can save, compile and run with the click of a single Compile & Run button in the Jupyter Notebooks.

Later, when you build the project, you'll move out of the notebooks and into a Linux virtual machine. At that point, you'll need to remember to compile and run the programs yourself!

If you haven't seen Jupyter Notebooks before, you can test one out below. A Notebook is a web application that allows for code, text, and visualizations to be combined and shared.

Check out the Notebook below for an example of how these will be used in the course.

When you use a Notebook Workspace, we encourage you to expand to a full screen view. Click on the EXPAND button in the lower left corner.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a